package recipe;

import common.db.DBExecute;
import common.main.MainBean;

public class RecipeUpdateBean extends MainBean
{
	public void funcExecute() throws Exception
	{				
		String seq = (String)inputTable.get("seq");
		String title = (String)inputTable.get("title");
		String content = (String)inputTable.get("content");
		String client = (String)inputTable.get("client");
		String id = (String)inputTable.get("id");
		
		if(title.indexOf("'") != -1)
		{
			title = title.replaceAll("'", "''");
		}

		if(content.indexOf("'") != -1)
		{
			content = content.replaceAll("'", "''");
		}
		
		queryBuffer = new StringBuffer("");
		queryBuffer.append("UPDATE RECIPE SET ");
		queryBuffer.append("TITLE='"+title+"', CONTENT='"+content+"', UPD_ID='"+id+"', UPD_DATE=SYSDATE, UPD_IP='"+client+"' ");
		queryBuffer.append("WHERE SEQ='"+seq+"' ");
		

		DBExecute dbe = new DBExecute(queryBuffer.toString());
		outputList = dbe.getDataList();		
	}
}
